package pers.gxm.visitor;

import java.util.ArrayList;
import java.util.Iterator;

public class ElementArrayList extends ArrayList<Element> implements Element{
//    private ArrayList<Element> list = new ArrayList<>();
//    public void add(Element element){
//        list.add(element);
//    }
    @Override
    public void accept(Visitor v) {
        Iterator<Element> iterator = this.iterator();
        while (iterator.hasNext()){
            Element element = iterator.next();
            element.accept(v);
        }
    }
}
